# -*- coding: utf-8 -*-
"""
 @Time    : 2021/2/24 下午4:49
 @Author  : tgy
 
"""

class TopExtra(type):
    ...
    def __call__(self, classname,superclasses,attributedict):
        ...
        print('1')
        obj = self.__new__(self,classname,superclasses,attributedict)
        print('2')
        self.__init__(obj,classname,superclasses,attributedict)
        print('3')
        print(obj)
        return obj

class Extra(type,metaclass=TopExtra):
    ...
    def __init__(self,classname,superclasses,attributedict):
        ...
        print('4')

    def __new__(cls, classname,superclasses,attributedict):
        print(5)
        return super().__new__(cls,classname,superclasses,attributedict)

    def run(cls):
        ...



class Person(metaclass=Extra):
    ...



if __name__ == '__main__':
    ...
    print(Person.run)
    person = Person()
    # 对象属性查找顺序，obj.__dict__ , dir(obj.__class__)
    print(person.run)
